using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace WebDauGia.Domain.Models.Mapping
{
    public class HangSanXuatMap : EntityTypeConfiguration<HangSanXuat>
    {
        public HangSanXuatMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.ten)
                .IsRequired();

            this.Property(t => t.quocgia)
                .HasMaxLength(100);

            this.Property(t => t.website)
                .HasMaxLength(100);

            this.Property(t => t.email)
                .HasMaxLength(100);

            this.Property(t => t.diachi)
                .HasMaxLength(1000);

            this.Property(t => t.sodt)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("HangSanXuat");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.ten).HasColumnName("ten");
            this.Property(t => t.quocgia).HasColumnName("quocgia");
            this.Property(t => t.website).HasColumnName("website");
            this.Property(t => t.email).HasColumnName("email");
            this.Property(t => t.diachi).HasColumnName("diachi");
            this.Property(t => t.sodt).HasColumnName("sodt");
            this.Property(t => t.mota).HasColumnName("mota");
        }
    }
}
